package com.ship.dispatch.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.dispatch.util.SpYearlyPlanProvider;
import com.ship.dispatch.vo.SpYearPlanDetailExportVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

public interface SpYearPlanSchemeDetailExMapper extends BaseMapper<SpYearPlanDetailExportVo> {
    /**
     * 获取导出列
     * @return
     */
    @Select("SELECT column_key FROM table_config WHERE `module` = 'sp_year_plan_scheme_detail';")
    List<String> getTableColumnList();

    /**
     * 动态sql查询
     * @return
     */
    @SelectProvider(type = SpYearlyPlanProvider.class, method = "getYearlyPlanSchemeByColumnKeys")
    List<SpYearPlanDetailExportVo> getYearPlanSchemeDetailList(@Param("columnKeys") List<String> columnKeys);

    /**
     * 获取资源方
     * @return
     */
    @Select("SELECT seller FROM con_resource_memorandum WHERE id = #{sellerId}")
    String getSeller(String sellerId);
}
